Repository navigation
feat(deploy): slice 2 — unit rendering, dry-run plans, generation log, status/rollback logic (#5766) - #7692
Merged
Conversation
…, status/rollback logic (#5766)
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 8, 2026 13:08
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slice 2 of issue #5766 (deploy tool v1), building on slice 1 (PR #6231, merged:
deployTargetsregistry +deploy list+ definition validation). Queue task 13021.What lands in
pkgs/deploy/deploy.py:render_unit) and a launchd plist stub (render_plist) from a registry definition. The renderedExecStart/ program path points at the service's per-service nix profilecurrentlink (/nix/var/nix/profiles/per-service/<name>/current/<entryPoint>, design §4.1) — never at a bare store path — so a generation flip is a profile repoint and the rendered file is identical for every generation of the same definition. systemd argument/environment quoting escapes whitespace, quotes, backslashes, and doubles the%/$introducers.deploy <target> --dry-run: the ordered §4.1 activation plan (build → install next generation into the profile → write unit/plist → daemon-reload → restart only that unit → health check → flip back on failure → append to the generation log), with no side effects.--state-dir/$DEPLOY_STATE_DIR), one record per activation event carrying generation id, source rev, artifact, timestamp, actor, action, result. Logs are never truncated (two generations always retained).deploy <target> status: folds the log into current/previous generations (a rollback event makes the generation it repointed to current) and reports the health verdict for the target'shealthCheckURL, or that no check is defined.rollbackcommand logic: selects the previous distinct generation (repointing, never rebuilding) and is refused when fewer than two distinct generations were ever current.nix-envprofile install,systemctlrestart, health-check flip-back — is the next slice: the non-dry-run deploy/rollback paths say so explicitly and exit non-zero rather than pretending to have activated something. The remaining on-laptop E2E acceptance from issue deploy tool v1: target registry (deployTargets) + systemd generation activation #5766 also stays open there.Tests
pkgs/deploy/test_deploy_slice2.py(21 tests, stdlib unittest): unit/plist rendering invariants, generation-log round-trip/fold/rollback-fold, plan ordering and flip-back step, rollback refusal cases, status formatting, and CLI subprocess cases (dry-run creates no state, real deploy refused, seeded-log status, unknown target). Oracle: design §4.1/§4.2/§4.6 + the issue text, named in the test module docstring.deploy-slice2-testsinlib/default.nixnext todeploy-dupkeys-property, running the new test file againstdeploy.pyin CI.deploy.py:test_dupkeys_property.py(300 cases, property holds),deploy liston a valid registry, malformed registry rejected with field-level errors,statuson an empty log.Refs #5766 (issue stays open for the activation slice + E2E acceptance).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.